<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <script src="../vueJS/VUE.js"></script>
</head>

<body>
    <div id="root">
        <!-- @click可以代替v-on:click -->
        <button v-on:click="showInfo">点我提示信息</button>
        <button v-on:click="showInfo1(20,$event)">点我获取参数</button>
        <!-- 防止传参进去event无法获取，可以手动用$event来获取 -->
    </div> 
    <script type="text/javascript">
    Vue.config.productionTip = false
    new Vue({
        el:'#root',
        data:{},
        methods:{
            showInfo(){//里面有一个参数event，记录着该事件的信息
                alert("hello!")
            },
            showInfo1(number){
                alert(number)
            }
        }
    })
    </script>
</body>
</html>